package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbKnowledgePointsMapper;
import com.ruoyi.teach.domain.NbKnowledgePoints;
import com.ruoyi.teach.service.INbKnowledgePointsService;

/**
 * 知识点Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbKnowledgePointsServiceImpl implements INbKnowledgePointsService 
{
    @Autowired
    private NbKnowledgePointsMapper nbKnowledgePointsMapper;

    /**
     * 查询知识点
     * 
     * @param id 知识点主键
     * @return 知识点
     */
    @Override
    public NbKnowledgePoints selectNbKnowledgePointsById(Long id)
    {
        return nbKnowledgePointsMapper.selectNbKnowledgePointsById(id);
    }

    /**
     * 查询知识点列表
     * 
     * @param nbKnowledgePoints 知识点
     * @return 知识点
     */
    @Override
    public List<NbKnowledgePoints> selectNbKnowledgePointsList(NbKnowledgePoints nbKnowledgePoints)
    {
        return nbKnowledgePointsMapper.selectNbKnowledgePointsList(nbKnowledgePoints);
    }

    /**
     * 查询知识点列表
     *
     * @param nbKnowledgePoints 知识点
     * @return 知识点集合
     */
    @Override
    public List<NbKnowledgePoints> selectNbKnowledgePointsTree(NbKnowledgePoints nbKnowledgePoints){
        return nbKnowledgePointsMapper.selectNbKnowledgePointsTree(nbKnowledgePoints);
    }

    /**
     * 新增知识点
     * 
     * @param nbKnowledgePoints 知识点
     * @return 结果
     */
    @Override
    public int insertNbKnowledgePoints(NbKnowledgePoints nbKnowledgePoints)
    {
        nbKnowledgePoints.setCreateTime(DateUtils.getNowDate());
        return nbKnowledgePointsMapper.insertNbKnowledgePoints(nbKnowledgePoints);
    }

    /**
     * 修改知识点
     * 
     * @param nbKnowledgePoints 知识点
     * @return 结果
     */
    @Override
    public int updateNbKnowledgePoints(NbKnowledgePoints nbKnowledgePoints)
    {
        nbKnowledgePoints.setUpdateTime(DateUtils.getNowDate());
        return nbKnowledgePointsMapper.updateNbKnowledgePoints(nbKnowledgePoints);
    }

    /**
     * 批量删除知识点
     * 
     * @param ids 需要删除的知识点主键
     * @return 结果
     */
    @Override
    public int deleteNbKnowledgePointsByIds(Long[] ids)
    {
        return nbKnowledgePointsMapper.deleteNbKnowledgePointsByIds(ids);
    }

    /**
     * 删除知识点信息
     * 
     * @param id 知识点主键
     * @return 结果
     */
    @Override
    public int deleteNbKnowledgePointsById(Long id)
    {
        return nbKnowledgePointsMapper.deleteNbKnowledgePointsById(id);
    }
}
